package com.rany.day07.demo02;

import java.util.ArrayList;

public class ForeachTest {
    public static void main(String[] args) {
        //数组使用增强for
        int[] a = {1,2,3};
        for (int i:a
             ) {
            System.out.println(i);
        }

        ArrayList<String> list = new ArrayList<>();
        list.add("haha");
        list.add("hehe");
        list.add("zeze");
        System.out.println(list);
        for (String str:list
             ) {
            System.out.println(str);
        }
    }
}
